<!DOCTYPE html>
<html>
<head>
  <meta content="text/html;charset=UTF-8"/>
  <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
  <title>国家公路网综合养护管理系统</title>
  <link rel="shortcut icon" th:href="@{/common/images/logo.png}" />
  <!-- Tell the browser to be responsive to screen width -->
  <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"/>
  <!-- Bootstrap 3.3.6 -->
  <link rel="stylesheet" th:href="@{/plugins/layui/css/layui.css}"/>
  <style>
		::-webkit-scrollbar-track {
		    background-color: #F5F5F5;
		}
		
		::-webkit-scrollbar {
		    width: 6px;
		    background-color: #F5F5F5;
		}
		
		::-webkit-scrollbar-thumb {
		    background-color: #999;
		}
		
		.layui-bg-black{
			background-color: #edf3fd;
		}
		
		.nav-label{
			color:#000;
		}
		.layui-icon {
			font-family: layui-icon !important;
			font-size: 16px;
			color:#000000;
			font-style: normal;
			-webkit-font-smoothing: antialiased;
			-moz-osx-font-smoothing: grayscale
		}
		
		.layui-nav-tree .layui-nav-item a:hover {
			background-color: #a7abb2
		}
		
	
		.layui-nav-child dd {
			position: relative;
			background-color: #edf3fd;
		}
		
		.layui-nav-tree .layui-nav-child dd.layui-this, .layui-nav-tree .layui-nav-child dd.layui-this a
			 {
			background-color: #a7abb2;
		}
		
		
		.layui-nav-tree .layui-nav-child dd.layui-this, .layui-nav-tree .layui-nav-child dd.layui-this a>:hover
		{
			background-color: #a7abb2;
		}
		
		
  </style>
  
</head>
<body  class="layui-layout-body"  style="overflow:hidden">
 <div class="layui-layout layui-layout-admin">
  <div class="layui-header" style="background-color: #428fb9;">
    <div class="layui-logo"  style="width: 300px;color:#ffffff;" ><img alt="" th:src="@{/common/images/logo.png}"/> 国家公路网综合养护管理系统</div>
    <!-- 头部区域（可配合layui已有的水平导航） -->
    <ul class="layui-nav layui-layout-left">
	     
    </ul>
    <ul class="layui-nav layui-layout-right">
    <li class="layui-nav-item" th:each="mods:${user.modules}" th:if="${#lists.size(#strings.listSplit(mods.parentIds,',')) eq 2}" >
	           <a th:href="@{/index(sysId=${mods.id})}" th:text="${mods.moduleName}"></a>
	     </li>
      <li class="layui-nav-item">
        <a href="javascript:void(0);">
          <img th:src="@{/dist/img/avatar04.png}"  class="layui-nav-img" />
   管理员
        </a>
        <dl class="layui-nav-child" >
          <dd style="background-color: #ffffff;"><a href="">基本资料</a></dd>
          <dd style="background-color: #ffffff;"><a href="">安全设置</a></dd>
          <dd style="background-color: #ffffff;"><a href="">退出</a></dd>
        </dl>
      </li>
    </ul>
  </div>
  <div class="main-frame" id="main-frame">
  
  	  <!-- 左侧菜单 -->	
	  <div class="layui-side layui-bg-black" >
	    <div class="layui-side-scroll" >
	      <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
	      <ul class="layui-nav layui-nav-tree"  lay-filter="test" id="side-menu">
	        <li class="layui-nav-item" th:if="${sysId ne null}" th:each="pas:${user.getNextModules(sysId)}" >
	          <a  href="javascript:void(0);" >
                        	<span class="nav-label" th:text="${pas.moduleName}"></span></a>
	          <dl class="layui-nav-child">
	          	  <dd   th:id="${'item_'+item.id}"  th:each="item:${user.getNextModules(pas.id)}">
	          	  					<!-- 如果是叶子节点，且有所属的平台， 则直接拼接平台url+link -->
                                	<a  th:if="${user.isLeaf(item.id) eq '1'}"  href="javascript:void(0);" th:id="${'item_'+item.id}"  th:onclick="'javascript:loadFrame(\''+${item.id}+'\',\''+${item.serverId}+'\',\''+${user.getNavInfos(item)}+'\',\''+${item.moduleLink}+'\');'"> 
                                	<span class="nav-label" style="padding-left: 5px;" th:text="${'&nbsp;&nbsp;' +item.moduleName}"></span>
             						</a>
                                	<!-- 如果不是叶子节点，则直接显示，不添加link地址 -->
                                	<a   th:if="${user.isLeaf(item.id) eq '0'}"  href="javascript:void(0);" th:onclick="'javascript:togglethree(\''+${item.id}+'\');'"  >
                                		<span class="nav-label" style="padding-left: 5px;" th:text="${'&nbsp;&nbsp;' +item.moduleName}"></span></a>
                                
                                
                                <!-- 三级菜单 -->	
                                <dl  style="display: none;"    th:each="three:${user.getNextModules(item.id)}" th:if="${three.isMenu eq '1'}">
                                    <dd >
                                    	<a th:id="${'item_'+three.id}"   style="background-color: #edf3fd;" href="javascript:void(0);"  th:onclick="'javascript:loadFrame(\''+${three.id}+'\',\''+${three.serverId}+'\',\''+${user.getNavInfos(three)}+'\',\''+${three.moduleLink}+'\');'"
                                    	 >
                                    		<span class="nav-label" style="padding-left: 25px;" th:text="${three.moduleName}"></span>
                                    	</a>
                                    </dd>
                                </dl>
                                
                   </dd>
	          </dl>
	        </li>
	      </ul>
	    </div>
	  </div>
	   <!-- 内容主体区域 -->
	  <div id="body-frame"  style="padding-left: 225px;">
	  		
	  		<div class="layui-tab"  style="height: 100%;" lay-filter="main" lay-allowclose="true">
			  <ul class="layui-tab-title">
			    <li class="layui-this" lay-id="mainpage">首页</li>
			  </ul>
			  <div id="contextframe" class="layui-tab-content" style="height: 100%;margin-top: -8px;">
			    <div class="layui-tab-item layui-show" style="height: 100%;"><iframe   name="iframe0" width="100%" height="100%" th:src="@{/appli}"  frameborder="0" ></iframe></div>
			  </div>
			</div>
	  </div>
  </div>
   <div class="layui-footer-all" style="padding-left: 230px;" >
	    <!-- 底部固定区域 -->
	    © lwjc.sub.xjjt.gov.cn - 交通运输部路网监测与应急处置中心
	</div>
</div>
  
 <script th:src="@{/plugins/layui/layui.js}" type="text/javascript"></script>
 <script th:src="@{/common/js/jquery-3.2.1.min.js}" type="text/javascript"></script>
 <script  th:inline="javascript" type="text/javascript">
 /*<![CDATA[*/
var basePath = /*[[@{/}]]*/

var active = null;
layui.use('element', function(){
	  var $ = layui.jquery
	  ,element = layui.element; //Tab的切换功能，切换事件监听等，需要依赖element模块
	  
	  //触发事件
	  active = {
	    tabAdd: function(layid,laytitle,laycontent){
	      //新增一个Tab项
	      element.tabAdd('main', {
	        title: laytitle //用于演示
	        ,content: laycontent
	        ,id: layid //实际使用一般是规定好的id，这里以时间戳模拟下
	      })
	    }
	    ,tabDelete: function(layid){
	      //删除指定Tab项
	      element.tabDelete('main', layid); //删除
	    }
	    ,tabChange: function(layid){
	      //切换到指定Tab项
	      element.tabChange('main', layid); //切换到：用户管理
	    }
	  };
});
 
 
 function togglethree(itemid){
	 $("#item_"+itemid +" dl").toggle();
 }

 

 var wh = $(window).height();
  
  $(function(){
 	 $("#body-frame").css("height",wh-100+'px');
 	$("#contextframe").css("height",wh-155+'px');
 	
  });
  

  $(window).resize(function() {
 	 $("#body-frame").css("height",wh-100+'px');
 	$("#contextframe").css("height",wh-155+'px');
  });

  
  function loadFrame(aid,serverId,navInfo,link){
	  
	  var isflag = false;
	  $(".layui-tab-title").find("li").each(function() {
              if($(this).attr("lay-id") == aid){
            	  active.tabChange(aid);
            	  isflag = true;
            	  return false;
              }
      });
	  
	  
	  if(isflag){
		  return false;
	  }
	  
		if(null == link || ''==link || 'null' == link){
			mini.alert("功能暂时未开通!");
			return false;
		}
		
		var layid = aid;
		
		var arr =  navInfo.split(",");
		var laytitle = arr[arr.length-1];
		var laycontent = "";
		
		var cotextRoot = /*[[@{/}]]*/
		if(null == serverId || 'null' == serverId){
			laycontent = '<iframe   name="iframe0" width="100%" height="100%" src="'+cotextRoot+link+'"  frameborder="0" ></iframe>';
		}else{
			laycontent = '<iframe   name="iframe0" width="100%" height="100%" src="'+serverId+'/'+link+'"  frameborder="0" ></iframe>';
		}
		//alert(active.tabAdd);
		active.tabAdd(layid,laytitle,laycontent);
		active.tabChange(layid);
}
  
/* function logout(){
	layer.confirm('确定退出系统？', {
		  title:"提醒",
		  btn: ['退出','取消'] //按钮
		  ,closeBtn: 0
		}, function(){
		  location.href=basePath+"logout";
		}, function(){
		  
		});
} */
/*]]>*/
</script>
</body>
</html>